export default class GLCatalog {
	getItem(path: string): Promise<GLItem> {
		return Promise.reject("GLCatalog is abstract");
	}
}

export class GLItem {
	constructor(private title: string, readonly uri: string) {}
	getItem(catalog: GLCatalog): Promise<GLItem> {
		return Promise.resolve(this);
	}
}

export class GLCatalogProvider {
	getCatalog() : Promise<GLCatalog> {
		return Promise.reject("Abstract");
	}
}

export class GLList extends GLItem {
	constructor(title: string, private items: Array<GLItem>, uri: string) {
		super(title, uri);
	}
}

export class GLLink extends GLItem {
	constructor(title: string, private target: string) {
		super(title, target);
	}
	getItem(catalog: GLCatalog): Promise<GLItem> {
		return catalog.getItem(this.target);
	}
}

export class GLContent extends GLItem {
	constructor(title: string, private content: string, uri: string, public focus?: string) {
		super(title, uri);
	}
}
